<template>
  <Form
    :label-width="100"
    ref="formValidate"
    :rules="ruleValidate"
    label-position="left"
    :model="formValidate"
  >
    <FormItem label="企业编号" prop="corpCode">
      <i-input
        type="text"
        v-model="formValidate.corpCode"
        placeholder="企业编号"
      >
      </i-input>
    </FormItem>
    <FormItem label="企业名称" prop="corpName">
      <i-input
        type="text"
        v-model="formValidate.corpName"
        placeholder="企业名称"
      >
      </i-input>
    </FormItem>
    <FormItem label="应用名称" prop="appName">
      <i-input
        type="text"
        v-model="formValidate.appName"
        placeholder="应用名称"
      >
      </i-input>
    </FormItem>

    <FormItem label="应用logo地址" prop="appLogoUrl">
      <i-input
        type="text"
        v-model="formValidate.appLogoUrl"
        placeholder="应用logo地址"
      >
      </i-input>
    </FormItem>

    <FormItem label="回调地址" prop="redirectUri">
      <i-input
        type="text"
        v-model="formValidate.redirectUri"
        placeholder="回调地址"
      >
      </i-input>
    </FormItem>
    <FormItem label="应用介绍" prop="appIntro">
      <i-input
        type="textarea"
        v-model="formValidate.appIntro"
        placeholder="应用介绍"
      >
      </i-input>
    </FormItem>
    <FormItem label="应用分组" prop="appGroup">
      <i-input
        type="text"
        v-model="formValidate.appGroup"
        placeholder="应用分组"
      >
      </i-input>
    </FormItem>
    <FormItem>
      <Button
        type="primary"
        @click="publicSubmit('formValidate')"
      >确定
      </Button>
      <Button @click="publicReset('formValidate')" style="margin-left: 8px">取消</Button>
    </FormItem>
  </Form>
</template>

<script>
import { updateMixin } from '../../../mixin'
import API_KEY from '../../../api'

export default {
  name: 'SsoCorpAppUpdate',
  mixins: [updateMixin],
  data () {
    return {
      ruleValidate: {
        appName: [{ required: true, message: '当前项不能为空', trigger: 'blur' }],
        corpName: [{ required: true, message: '当前项不能为空', trigger: 'blur' }],
        corpCode: [{ required: true, message: '当前项不能为空', trigger: 'blur' }]
      },
      // 请求地址
      action: {
        // 新增数据
        createData: API_KEY.systemSsoCorpApp.def,
        // 更新数据
        updateData: API_KEY.systemSsoCorpApp.def,
        readDataById: API_KEY.systemSsoCorpApp.def
      },
      formValidate: {
        appName: '',
        corpName: '',
        appLogoUrl: '',
        redirectUri: '',
        appIntro: '',
        appGroup: '',
        corpCode: ''
      }
    }
  }
}
</script>

<style scoped>

</style>
